# Maintainer: Filipe Laíns (FFY00) <lains@archlinux.org>
# Contributor: Dustin Falgout <dustin@antergos.com>

pkgname=lightdm-webkit2-greeter
_pkgname=web-greeter
pkgver=2.2.5
pkgrel=6
pkgdesc='LightDM greeter that uses WebKit2 for theming via HTML/JavaScript.'
arch=('loong64' 'x86_64')
url='https://github.com/antergos/web-greeter'
license=('GPL3')
depends=('lightdm' 'webkit2gtk' 'accountsservice' 'gnome-backgrounds')
makedepends=('gobject-introspection' 'meson' 'gettext' 'dbus-glib')
backup=("etc/lightdm/$pkgname.conf")
source=("$_pkgname-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz"
        'archlinux-logo.svg::https://sources.archlinux.org/other/artwork/archlinux-logo-light-scalable.svg'
        'archlinux-user.svg')
sha512sums=('173fe64dc3ff9bde0bc3d72319ab014001364eae8336a72b052333e0c6687167164277fd87de7051c689f12f64aeb441f95a9f0d38cc780ccb77751ab62204da'
            'a553510431d3771a0ef5c7aaec198f89302f11ea8fe6db83bdac496d087ded6d5a99e442d3d20fd7b9231a76ec0df0f1ffb3da2511f79d196c8516345241d1da'
            '4cf515e5eefa0a16d1ebda6e4cbef2103e405325e265472c3cdc4928f05749597913406494fc4384b268288efbc0bbb86fefb648d1dd6e62c1dbc6569c8253b6')

prepare() {
  cd $_pkgname-$pkgver

  # Replace antergos logos
  sed -i \
  	-e 's|/usr.*antergos.png|/usr/share/pixmaps/archlinux-logo.svg|g;' \
  	-e 's|/usr.*logo-user.png|/usr/share/pixmaps/archlinux-user.svg|g' \
  	"data/$pkgname.conf"
}

build() {
  cd $_pkgname-$pkgver/build

  arch-meson ..

  ninja
}

package() {
  cd $_pkgname-$pkgver/build

  DESTDIR="$pkgdir" ninja install
}

